package com.epmxx.common;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description: 业务结果的包装类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result {
    private Integer code = 200; // 业务码
    private String msg = "成功"; // 业务消息
    private Object data; // 业务数据

    /**
     * 业务成功有数据
     *
     * @param data
     */
    public Result(Object data) {
        this.data = data;
    }

    /**
     * 业务失败
     *
     * @param code
     * @param msg
     */
    public Result(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }
}